home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5181 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  30 lines

  1. Path: velveeta.mctec.com!calster
  2. From: cal@visual.mctec.com (Cal Lin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Specifying packing or padding alignment in classes and structs
  5. Date: 2 Feb 1996 21:46:41 GMT
  6. Organization: Visual Networks, Inc.
  7. Message-ID: <4eu0o1$1je@velveeta.mctec.com>
  8. NNTP-Posting-Host: calvinl.mctec.com
  9. Keywords: SPARCompiler 4.0.1
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. How do you specify, with a #pragma directive or something else, the packing or 
  13. padding alignment within a class or struct on SUN's SPARCompiler?  For 
  14. example, if a struct is declared as follows:
  15. struct foobar {
  16.     char foo;
  17.     double bar;
  18. } fb;
  19. sizeof (fb) should be 9 if packed, 12 if not.  On our AIX C++ 3.1 compiler, 
  20. the directive is #pragma align=packed, and on Visual C++, the directive is 
  21. #pragma pack(1).
  22.  
  23. I've looked through the documentation on the SUN compiler, and have found 
  24. nothing that fits the bill.  Does anybody know how to do this on the 
  25. SPARCompiler?
  26.  
  27. Thanks in advance.
  28.     cal@visual.mctec.com
  29.     (301)208-6793   
  30.